Field of the Invention
The present invention relates to a system for performing near field communication, a communication apparatus, a communication method, and a storage medium storing a program.
Description of the Related Art
In recent years, it is known that a mobile terminal transmits/receives data of a relatively large size using wireless communication. To implement efficient communication in consideration of a communication speed and operability, it is known to perform data communication by two kinds of methods. There is known a technique of transmitting/receiving information necessary for the second wireless communication method of a communication target apparatus by the first short distance wireless communication capable of reliably specifying a communication partner, and performing high-speed communication by switching the communication to the second wireless communication method using the information (Japanese Patent Laid-Open No. 2011-87249).
The first short distance wireless communication method is, for example, NFC (Near Field Communication), and the second wireless communication method is, for example, Bluetooth® or wireless LAN (to be referred to as WLAN hereinafter). Japanese Patent Laid-Open No. 2011-87249 describes a printer which first transmits information of the communication method and cryptographic system of next communication by NFC and, when communication is to be switched, switches the communication to execute printing using the second wireless communication method. Processing of performing pairing by the first short distance wireless communication method and then switching the communication to the second wireless communication method will be referred to as a handover hereinafter.
On the other hand, there is known a public key cryptographic system of an algorithm for encrypting a document. The public key cryptographic system is a method of using a key for encryption/decryption generally called a distributable public key, and performs encryption processing for ciphertext, to be sent to a specific person, by using a public key issued by the specific person. Ciphertext encrypted by the public key can be decrypted by only a private key corresponding to the public key. Since the specific person who has issued the public key confidentially holds the private key, only the specific person who holds the private key can decrypt a document encrypted by the public key. An RSA cryptographic system is known as a public key cryptographic system.
Consider, for example, a case in which a handover for switching communication from NFC communication to WLAN communication is used to execute printing by transmitting data from a mobile terminal to an image processing apparatus such as a multi-function printer (to be referred to as an MFP hereinafter). In terms of security, it is desirable that protocol information and data communication information for wireless communication of the mobile terminal which performs transmission by NFC communication or WLAN communication are encrypted. Conventionally, since an encryption key is stored in the main memory of the MFP, it cannot be read out while the MFP is in a power-off mode or sleep mode. Therefore, when executing a handover while the MFP is in a power-off mode or sleep mode, the user of the mobile terminal has to wait in front of the MFP until it becomes possible to read out the encryption key from the MFP.